<template>
	<view>
		<view class="one">
			<image src="../../static/c6.png" mode="" style="margin: 0 auto;display: block;width: 100px;height: 100px;">
			</image>
		</view>

		<uni-forms ref="form" :rules="{}">
			<uni-forms-item label="" name="">
				<uni-easyinput v-model="userInfo.username" placehoIder="请输入用户名" @iconClick="iconClick"
					prefixIcon="contact-filled" />
			</uni-forms-item>
			<uni-forms-item label="" name="">
				<uni-easyinput v-model="userInfo.password" placeholder="请输入密码" prefixIcon="locked" type="password" />
			</uni-forms-item>
			<uni-forms-item label="" name="">
				<button type="primary" :plain="true" :loading="false" @click="login">登录</button>
			</uni-forms-item>
		</uni-forms>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: {
					username: '',
					password: ''
				}
			}
		},
		methods: {
			login() {
				if (this.userInfo.username === 'lc' && this.userInfo.password === '123') {
					uni.showToast({
						title: '欢迎你' + this.userInfo.username
					});
				} else {
					uni.showToast({
						title: '用户名和密码错误',
						icon: 'none'
					});
				}
			},
			iconClick(e) {
				console.log(e);
			}
		}
	}
</script>

<style>

</style>